package com.zzf.concurrent.example.design.pattern.active.object;

/**
 * 生成字符串的副本，按给定的
 * @author GaoFeng2017
 * @date 2019/9/11 14:33
 */
public class MakeStringRequest extends MethodRequest {

    private final int count;
    private final char ch;

    public MakeStringRequest(Servant servant, FutureResult futureResult, int count, char ch) {
        super(servant, futureResult);
        this.count = count;
        this.ch = ch;
    }

    @Override
    public void execute() {
        Result result = this.servant.makeString(count, ch);
        this.futureResult.setResultValue(result);
    }

}
